//
// Created by blensmile on 2018/12/14.
//
#include <jni.h>
#include "ffmpeg.h"
#include "com_blensmile_ffmpeglib_FFUtils.h"

JNIEXPORT jint JNICALL
Java_com_blensmile_ffmpeglib_FFUtils_run(JNIEnv *env, jclass type, jobjectArray commands) {

    int argc = (*env)->GetArrayLength(env, commands);
    char *argv[argc];
    int i;
    for (i = 0; i < argc; i++) {
        jstring js = (jstring) (*env)->GetObjectArrayElement(env, commands, i);
        argv[i] = (char*) (*env)->GetStringUTFChars(env, js, 0);
    }
    return run(argc, argv);

}

